package com.sig.opengl;

import com.sig.core.Tab;

import android.graphics.Canvas;
import android.graphics.Color;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

  // Flo j'ai le pouvoir :D
public class OpengGLFragment extends Tab {

	private MyGLSurfaceView _surfaceView = null;

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		
		if(_surfaceView != null){
			Canvas c = new Canvas();
			c.drawColor( Color.BLACK );
			_surfaceView.draw(c);
		}
		
		_surfaceView = new MyGLSurfaceView(this.getActivity());
		return _surfaceView;
		//_GLView.requestRender();
	}

	@Override
	public void onPause() {
		super.onPause();
		if (_surfaceView != null) { _surfaceView.onPause(); }
	}

	@Override
	public void onResume() {
		super.onResume();
		if (_surfaceView != null) { _surfaceView.onResume(); }
	}

	@Override
	public CharSequence getTitle() {
		return "OpenGL";
	}

}
